/*     */ package com.lmpop.trade.ti_evaluate;
/*     */ 
/*     */ import com.lmpop.frame.QueryList;
/*     */ import com.lmpop.frame.SysMap;
/*     */ import com.lmpop.frame.TradeInterf;
/*     */ import com.lmpop.frame.dao.DbmInterf;
/*     */ import com.lmpop.frame.exp.ApplicationException;
/*     */ import com.lmpop.frame.util.RandomID;
/*     */ import com.lmpop.trade.tb_commpara.Tb_commparaInfo;
/*     */ import java.util.Hashtable;
/*     */ import java.util.List;
/*     */ import java.util.Map;
/*     */ 
/*     */ public class Ti_evaluateInfo
/*     */   implements TradeInterf
/*     */ {
/*     */   QueryList queryList;
/*     */ 
/*     */   public Ti_evaluateInfo()
/*     */   {
/*  18 */     this.queryList = new QueryList();
/*     */   }
/*     */ 
/*     */   public SysMap insert(DbmInterf dbmMgr, SysMap map)
/*     */   {
/*  28 */     String result_code = "0";
/*     */     try {
/*  30 */       String order_no = map.getString("order_no");
/*  31 */       String cust_id = map.getString("cust_id");
/*  32 */       String content = map.getString("content");
/*  33 */       String session_user_id = map.getString("session_user_id");
/*  34 */       int info_level = map.getInt("info_level");
/*  35 */       int same_num = map.getInt("same_num");
/*  36 */       int service_num = map.getInt("service_num");
/*  37 */       int speed_num = map.getInt("speed_num");
/*  38 */       RandomID randomID = new RandomID();
/*  39 */       if (!cust_id.equals(""))
/*     */       {
/*  41 */         String[] cust_ids = cust_id.split("\\|");
/*  42 */         for (int i = 0; i < cust_ids.length; i++)
/*     */         {
/*  44 */           String info_id = randomID.GenTradeId();
/*  45 */           Map paramsMap = new Hashtable();
/*  46 */           paramsMap.put("info_id", info_id);
/*  47 */           paramsMap.put("cust_id", cust_ids[i]);
/*  48 */           paramsMap.put("order_no", order_no);
/*  49 */           paramsMap.put("send_user_id", session_user_id);
/*  50 */           paramsMap.put("content", content);
/*  51 */           paramsMap.put("info_level", Integer.valueOf(info_level));
/*  52 */           paramsMap.put("same_num", Integer.valueOf(same_num));
/*  53 */           paramsMap.put("service_num", Integer.valueOf(service_num));
/*  54 */           paramsMap.put("speed_num", Integer.valueOf(speed_num));
/*     */ 
/*  56 */           insert(dbmMgr, paramsMap);
/*     */         }
/*     */       }
/*     */     } catch (ApplicationException e) {
/*  60 */       e.printStackTrace();
/*  61 */       result_code = "1";
/*     */     }
/*  63 */     map.setString("result_code", result_code);
/*  64 */     return map;
/*     */   }
/*     */ 
/*     */   public void insert(DbmInterf dbmMgr, Map paramsMap)
/*     */     throws ApplicationException
/*     */   {
/*  73 */     dbmMgr.update("insertTi_evaluate", paramsMap);
/*     */   }
/*     */ 
/*     */   public SysMap delete(DbmInterf dbmMgr, SysMap map)
/*     */   {
/*  83 */     String pkid_string = map.getString("pkid");
/*  84 */     String result_code = "0";
/*     */     try {
/*  86 */       if (!pkid_string.equals("")) {
/*  87 */         String[] pkStr = pkid_string.split("\\|");
/*  88 */         for (int i = 0; i < pkStr.length; i++) {
/*  89 */           if (pkStr[i].equals("")) continue; delete(dbmMgr, pkStr[i]);
/*     */         }
/*     */       }
/*     */     } catch (ApplicationException e) {
/*  93 */       e.printStackTrace();
/*  94 */       result_code = "1";
/*     */     }
/*  96 */     map.setString("result_code", result_code);
/*  97 */     return map;
/*     */   }
/*     */ 
/*     */   public void delete(DbmInterf dbmMgr, String pkid)
/*     */     throws ApplicationException
/*     */   {
/* 106 */     dbmMgr.update("deleteTi_evaluate", pkid);
/*     */   }
/*     */ 
/*     */   public SysMap update(DbmInterf dbmMgr, SysMap map)
/*     */   {
/* 115 */     Ti_evaluate ti_evaluate = new Ti_evaluate();
/* 116 */     ti_evaluate.setInfo_id(map.getString("info_id"));
/*     */ 
/* 118 */     ti_evaluate.setReply_content(map.getString("reply_content"));
/*     */ 
/* 120 */     ti_evaluate.setPub_user_id(map.getString("session_user_id"));
/*     */ 
/* 122 */     String result_code = "0";
/*     */     try {
/* 124 */       update(dbmMgr, ti_evaluate);
/*     */     } catch (ApplicationException e) {
/* 126 */       e.printStackTrace();
/* 127 */       result_code = "1";
/*     */     }
/* 129 */     map.setString("result_code", result_code);
/* 130 */     return map;
/*     */   }
/*     */ 
/*     */   public void update(DbmInterf dbmMgr, Ti_evaluate ti_evaluate)
/*     */     throws ApplicationException
/*     */   {
/* 139 */     dbmMgr.update("updateTi_evaluate", ti_evaluate);
/*     */   }
/*     */ 
/*     */   public List getListByPage(Object obj, int start, int limit)
/*     */   {
/* 149 */     Map params = (Hashtable)obj;
/* 150 */     if (start == 0)
/* 151 */       start = 0;
/*     */     else {
/* 153 */       start = (start - 1) * limit;
/*     */     }
/* 155 */     params.put("start", Integer.valueOf(start));
/* 156 */     params.put("limit", Integer.valueOf(limit));
/* 157 */     return this.queryList.getList("getListByTi_evaluatePage", params);
/*     */   }
/*     */ 
/*     */   public int getCountByObj(Object obj)
/*     */   {
/* 168 */     Map params = (Hashtable)obj;
/* 169 */     List list = this.queryList.getList("getCountByObjTi_evaluate", params);
/* 170 */     int count = 0;
/* 171 */     if (list != null)
/*     */     {
/* 173 */       count = list.size();
/*     */     }
/* 175 */     return count;
/*     */   }
/*     */ 
/*     */   public List getAllCustListforOrder(Map params)
/*     */   {
/* 186 */     return this.queryList.getList("getCustTi_evaluate", params);
/*     */   }
/*     */ 
/*     */   public List getListByPk(String pk)
/*     */   {
/* 195 */     return this.queryList.getList("getTi_evaluateByPk", pk);
/*     */   }
/*     */ 
/*     */   public String checkEavReply(Map params)
/*     */   {
/* 206 */     List elist = this.queryList.getList("checkTi_evaluateReply", params);
/* 207 */     String reply_content = "0";
/* 208 */     if ((elist != null) && (elist.size() > 0))
/*     */     {
/* 210 */       Hashtable eMap = (Hashtable)elist.get(0);
/* 211 */       if (eMap.get("reply_content") != null)
/*     */       {
/* 213 */         if (!eMap.get("reply_content").toString().trim().equals(""))
/*     */         {
/* 215 */           reply_content = "1";
/*     */         }
/*     */       }
/*     */     }
/*     */ 
/* 220 */     return reply_content;
/*     */   }
/*     */ 
/*     */   public List getNotReplyListByPage(Object obj, int start, int limit)
/*     */   {
/* 231 */     Map params = (Hashtable)obj;
/* 232 */     if (start == 0)
/* 233 */       start = 0;
/*     */     else {
/* 235 */       start = (start - 1) * limit;
/*     */     }
/* 237 */     params.put("start", Integer.valueOf(start));
/* 238 */     params.put("limit", Integer.valueOf(limit));
/* 239 */     Tb_commparaInfo tb_commparaInfo = new Tb_commparaInfo();
/* 240 */     String limit_date = tb_commparaInfo.getOnCPcode2Byparam_attr("28");
/* 241 */     params.put("limit_date", limit_date);
/* 242 */     return this.queryList.getList("getTi_evaluateNotReply", params);
/*     */   }
/*     */ 
/*     */   public int getNotReplyCountByObj(Object obj)
/*     */   {
/* 253 */     Map params = (Hashtable)obj;
/* 254 */     Tb_commparaInfo tb_commparaInfo = new Tb_commparaInfo();
/* 255 */     String limit_date = tb_commparaInfo.getOnCPcode2Byparam_attr("28");
/* 256 */     params.put("limit_date", limit_date);
/* 257 */     List list = this.queryList.getList("getTi_evaluateNotReplyCount", params);
/* 258 */     int count = 0;
/* 259 */     if ((list != null) && (list.size() > 0)) {
/* 260 */       Hashtable newsMap = (Hashtable)list.get(0);
/* 261 */       if ((newsMap.get("count") != null) && (!newsMap.get("count").toString().equals(""))) {
/* 262 */         count = Integer.parseInt(newsMap.get("count").toString());
/*     */       }
/*     */     }
/* 265 */     return count;
/*     */   }
/*     */ 
/*     */   public Hashtable getOneEvaluate(Map params)
/*     */   {
/* 276 */     List eList = this.queryList.getList("getOneTi_evaluate", params);
/* 277 */     if ((eList != null) && (eList.size() > 0))
/*     */     {
/* 279 */       return (Hashtable)eList.get(0);
/*     */     }
/*     */ 
/* 283 */     return new Hashtable();
/*     */   }
/*     */ 
/*     */   public String getInfoIDByOrder_no(Map params)
/*     */   {
/* 289 */     String info_id = "";
/* 290 */     List eList = this.queryList.getList("getOneTi_evaluate", params);
/* 291 */     if ((eList != null) && (eList.size() > 0))
/*     */     {
/* 293 */       Map map = (Hashtable)eList.get(0);
/* 294 */       if ((map.get("info_id") != null) && (!map.get("info_id").toString().equals(""))) {
/* 295 */         info_id = map.get("info_id").toString();
/*     */       }
/*     */     }
/* 298 */     return info_id;
/*     */   }
/*     */ 
/*     */   public List getCustReplyListByPage(Object obj, int start, int limit)
/*     */   {
/* 309 */     Map params = (Hashtable)obj;
/* 310 */     if (start == 0)
/* 311 */       start = 0;
/*     */     else {
/* 313 */       start = (start - 1) * limit;
/*     */     }
/* 315 */     params.put("start", Integer.valueOf(start));
/* 316 */     params.put("limit", Integer.valueOf(limit));
/* 317 */     return this.queryList.getList("getCustTi_evaluateReply", params);
/*     */   }
/*     */ 
/*     */   public int getCustReplyCountByObj(Object obj)
/*     */   {
/* 329 */     Map params = (Hashtable)obj;
/* 330 */     List list = this.queryList.getList("getCustTi_evaluateReplyCount", params);
/* 331 */     int count = 0;
/* 332 */     if ((list != null) && (list.size() > 0)) {
/* 333 */       Hashtable newsMap = (Hashtable)list.get(0);
/* 334 */       if ((newsMap.get("count") != null) && (!newsMap.get("count").toString().equals(""))) {
/* 335 */         count = Integer.parseInt(newsMap.get("count").toString());
/*     */       }
/*     */     }
/* 338 */     return count;
/*     */   }
/*     */ 
/*     */   public boolean checkIsnotEvaluate(String order_no)
/*     */   {
/* 349 */     List list = this.queryList.getList("checkIsnotEvaluate", order_no);
/* 350 */     boolean isNot = true;
/* 351 */     if ((list != null) && (list.size() > 0)) {
/* 352 */       return false;
/*     */     }
/* 354 */     return isNot;
/*     */   }
/*     */ 
/*     */   public int getEvaluateCountByUserId(String user_id)
/*     */   {
/* 365 */     List list = this.queryList.getList("getEvaluateCountByUserId", user_id);
/* 366 */     int count = 0;
/* 367 */     if ((list != null) && (list.size() > 0)) {
/* 368 */       Hashtable newsMap = (Hashtable)list.get(0);
/* 369 */       if ((newsMap.get("count") != null) && (!newsMap.get("count").toString().equals(""))) {
/* 370 */         count = Integer.parseInt(newsMap.get("count").toString());
/*     */       }
/*     */     }
/* 373 */     return count;
/*     */   }
/*     */ }

/* Location:           F:\电商\commons-utils.jar
 * Qualified Name:     com.lmpop.trade.ti_evaluate.Ti_evaluateInfo
 * JD-Core Version:    0.6.0
 */